package primitives;

import java.util.ArrayList;

import ray.Ray;

import colour.Colour;

import camera.Camera;

import light.Light;

/**
 * This class is a class for presenting all 3d objects
 * 
 * @author Yuting Wu
 * @author Kan Lin
 */
public class World3D {
	private ArrayList<AbstractShape> shape;
	private Camera camera;
	private ArrayList<Light> light;
	private Ray[][] raylist;

	private int reflectionDepth;
	private Colour background;
	private boolean ifShadowAndReflect;


	/**
	 * 
	 * @param shape
	 * @param light
	 * @param background
	 */
	public World3D(ArrayList<AbstractShape> shape, ArrayList<Light> light,
			Colour background, Camera camera) {
		super();
		this.shape = shape;
		this.light = light;
		if (background == null) {
			//default background is white
			this.background = new Colour(255, 255, 255);
		} else {
			this.background = background;
		}
		this.camera = camera;
	}

	/**
	 * @param raylist
	 *            the raylist to set
	 */
	public void setRaylist(Ray[][] raylist) {
		this.raylist = raylist;
	}

	/**
	 * @param reflectionDepth
	 *            the reflectionDepth to set
	 */
	public void setReflectionDepth(int reflectionDepth) {
		this.reflectionDepth = reflectionDepth;
	}

	/**
	 * @return the ifShadowAndReflect
	 */
	public boolean isIfShadowAndReflect() {
		return ifShadowAndReflect;
	}

	/**
	 * @param ifShadowAndReflect
	 *            the ifShadowAndReflect to set
	 */
	public void setIfShadowAndReflect(boolean ifShadowAndReflect) {
		this.ifShadowAndReflect = ifShadowAndReflect;
	}

	/**
	 * 
	 * @return camera 
	 */
	public Camera getCamera() {
		return camera;
	}

	/**
	 * @return the shape
	 */
	public ArrayList<AbstractShape> getShape() {
		return shape;
	}

	/**
	 * @return the light
	 */
	public ArrayList<Light> getLight() {
		return light;
	}

	/**
	 * @return the reflectionDepth
	 */
	public int getReflectionDepth() {
		return reflectionDepth;
	}

	/**
	 * @return the background
	 */
	public Colour getBackground() {
		return background;
	}

	/**
	 * @return the raylist
	 */
	public Ray[][] getRaylist() {
		return raylist;
	}

}
